Simplify $assoc check
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 20 Dec 2011 20:15:42 +0000 (20:15 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 20 Dec 2011 20:15:42 +0000 (20:15 +0000)
includes/json/FormatJson.php

index 0f5f7d5..f7373e4 100644 (file)
@@ -54,10 +54,8 @@ class FormatJson {
         */
        public static function decode( $value, $assoc = false ) {
                if ( !function_exists( 'json_decode' ) ) {
-                       if( $assoc )
-                               $json = new Services_JSON( SERVICES_JSON_LOOSE_TYPE );
-                       else
-                               $json = new Services_JSON();
+                       $json = $assoc ? new Services_JSON( SERVICES_JSON_LOOSE_TYPE ) :
+                               new Services_JSON();
                        $jsonDec = $json->decode( $value );
                        return $jsonDec;
                } else {